
        REAL*8 FUNCTION MASS_FUN(ulim,dlim,mi)
        IMPLICIT NONE
        REAL*8  ulim    ,dlim, mi,randnum,mip
        mip=mi+1
        CALL RANDOM_NUMBER(randnum)
        result = (randnum*(ulim**mip-dlim**mip)+dlim**mip)**(1/mip)

        RETURN
        END

